package com.eagle.gennewdata.listener;

import java.util.TimerTask;

import javax.servlet.ServletContext;
import com.eagle.gennewdata.logic.INewData;
import com.eagle.gennewdata.logic.NewDataImpl;

public class RefrashDataTask extends TimerTask {

	private ServletContext m_Content = null;
	
	public RefrashDataTask(ServletContext content)
	{
		m_Content = content;
	}
	
	protected INewData getService(){	
		Object service = m_Content.getAttribute("eagle_server_interface");
		if(service==null){
			try
			{
				service = new NewDataImpl();
				m_Content.setAttribute("eagle_server_interface", service);
			}catch (Exception e) {
				// TODO: handle exception
			}
		}
		return (INewData) service;
	}
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		INewData iNewData = new NewDataImpl();
		iNewData.PaserXmlUrl("http://mrss.dokoda.jp/a/http/www.cnbeta.com/backend.php");
	}

}
